package com.hdu.executor;

import lombok.Data;

import java.util.List;

@Data
public class RunningComplexExpression {
    private boolean hit;
    private List<RunningBasicExpression> runningBasicExpressions;
    private List<RunningComplexExpression> runningComplexExpressions;

    public static RunningComplexExpression fail() {
        RunningComplexExpression runningComplexExpression = new RunningComplexExpression();
        runningComplexExpression.setHit(false);
        return runningComplexExpression;
    }

    public static RunningComplexExpression success(List<RunningBasicExpression> runningBasicExpressions,
                                                   List<RunningComplexExpression> runningComplexExpressions) {
        RunningComplexExpression runningComplexExpression = new RunningComplexExpression();
        runningComplexExpression.setHit(true);
        if (runningBasicExpressions != null) {
            runningComplexExpression.setRunningBasicExpressions(runningBasicExpressions);
        }
        if (runningComplexExpressions != null) {
            runningComplexExpression.setRunningComplexExpressions(runningComplexExpressions);
        }
        return runningComplexExpression;
    }
}
